Prizm Content Connect
Viewing Sessions

Optimizing Cache Performance

Viewing Session resources require a number of conversions to create content that is suitable for viewing. Caching the converted content plays a large role in the performance of the PCC RESTful Web Services when handling requests for a Viewing Session. In single-server mode, caching is the most optimized because all converted content is available to the PCC service on that server. As requests for new viewing sessions are received, the new documents are examined to locate existing content that may already be created if the same document was used in a previous viewing session.

In multi-server mode, the PCC service on each server maintains its own cache data, separate from other PCC servers. Cache data is not shared across servers. Because of this, the effort to convert the same document will likely be duplicated on multiple PCC servers if you have a situation where users are frequently viewing the same document more than once.

To counteract this side-effect of multi-server mode, the PCC RESTful Web Services provide a way to increase the chances that a request for a new viewing session will be sent to the same PCC server that may have already converted the same document. This is done by providing a "hint" value in a HTTP header of the request to create new viewing sessions. Below is an example request that sets this header:

Example
Copy Code
POST http://192.168.0.1:18682/PCCIS/V1/ViewingSession
Accusoft-Affinity-Hint: my-unique-document-name.docx
{
    "tenantId": "my application name",
    "externalId": "my-unique-document-name.docx",
    "render": {
        "flash": {
            "optimizationLevel": 1
        },
        "html5": {
            "alwaysUseRaster": false
        }
    }
}

The Accusoft-Affinity-Hint header should only be specified in the HTTP request that creates a new viewing session.

It is important to note that the value used in this header should uniquely identify the document. A document name or a unique ID from a database are good options. Using the same value for documents that are not identical will unbalance the requests across the PCC servers as it will cause a single server to be favored for all requests that contain the same hint value.

 

 


©2014. Accusoft Corporation. All Rights Reserved.

Send Feedback